.TH std::extents::rank_dynamic 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::extents::rank_dynamic \- std::extents::rank_dynamic

.SH Synopsis
   static constexpr rank_type rank_dynamic() const noexcept;  (since C++23)

   Returns the number of dynamic dimensions in extents.

.SH Parameters

   \fI(none)\fP

.SH Return value

   The number of dynamic dimensions.

.SH Example


// Run this code

 #include <iostream>
 #include <mdspan>

 int main()
 {
     std::extents<int, 1, 2> e1;
     std::extents<int, 3, 4, std::dynamic_extent> e2(5);
     std::extents<int, std::dynamic_extent, 7, std::dynamic_extent> e3(6, 8);
     std::cout << e1.rank_dynamic() << ", "
               << e2.rank_dynamic() << ", "
               << e3.rank_dynamic() << '\\n';
 }

.SH Output:

 0, 1, 2

.SH See also

   rank     returns the static rank of an extents
   \fB[static]\fP \fI(public static member function)\fP
   rank     obtains the number of dimensions of an array type
   \fI(C++11)\fP  \fI(class template)\fP
